package com.gzx.plugin.website.articles.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gzx.plugin.website.articles.bo.GzxWebsiteArticlesAddOrEditBo;
import com.gzx.plugin.website.articles.bo.GzxWebsiteArticlesOutQueryBo;
import com.gzx.plugin.website.articles.bo.GzxWebsiteArticlesQueryBo;
import com.gzx.plugin.website.articles.service.GzxWebsiteArticlesService;
import com.gzx.plugin.website.articles.vo.GzxWebsiteArticlesOutVo;
import com.gzx.plugin.website.articles.vo.GzxWebsiteArticlesVo;
import org.springframework.web.bind.annotation.*;
import vip.xiaonuo.common.mvc.controller.BaseController;
import vip.xiaonuo.common.pojo.CommonResult;

/**
 * @author zjt
 * @description
 * @date 2025/4/22 14:11
 */
@RestController
@RequestMapping("/website/articles")
public class GzxWebsiteArticlesController extends BaseController<GzxWebsiteArticlesAddOrEditBo, GzxWebsiteArticlesVo, GzxWebsiteArticlesQueryBo, GzxWebsiteArticlesService> {
    public GzxWebsiteArticlesController(GzxWebsiteArticlesService baseService) {
        super(baseService);
    }

    @PostMapping("/aasd")
    public CommonResult<Page<GzxWebsiteArticlesOutVo>> getArticlesByType(@RequestBody GzxWebsiteArticlesOutQueryBo websiteArticlesOutQueryBo) {
        return CommonResult.data(baseService.getArticlesByType(websiteArticlesOutQueryBo));
    }

    @PostMapping("/cscz/{id}")
    public CommonResult<String> getArticlesContentById(@PathVariable Long id) {
        return CommonResult.data(baseService.getArticlesContentById(id));
    }
}
